<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Layering Cache</title>
    <meta name="description" content="这是一个 table 页面">
    <meta name="keywords" content="table">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="css/amazeui.min.css"/>
    <link rel="stylesheet" href="css/admin.css">
</head>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
    以获得更好的体验！</p>
<![endif]-->

<header class="am-topbar am-topbar-inverse admin-header">
    <div class="am-topbar-brand">
        <strong>Layering Cache</strong>
        <small>缓存查看</small>
    </div>

    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only"
            data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span
            class="am-icon-bars"></span></button>

    <div class="am-collapse am-topbar-collapse" id="topbar-collapse">

        <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
            <li id="login-out"><a href="javascript:;"><span class="am-icon-power-off"></span> 退出 </a></li>
            <li class="am-hide-sm-only">
                <a href="javascript:;" id="admin-fullscreen">
                    <span class="am-icon-arrows-alt"></span>
                    <span class="admin-fullText">开启全屏</span>
                </a>
            </li>
        </ul>
    </div>
</header>

<div class="am-cf admin-main">
    <!-- sidebar start -->
    <div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
        <div class="am-offcanvas-bar admin-offcanvas-bar">
            <ul class="am-list admin-sidebar-list">
                <li><a href="index.html"><span class="am-icon-home"></span> 监控管理</a></li>
                <li><a href="cache.html"><span class="am-icon-pencil-square-o"></span> 缓存查看</a></li>
                <!--<li><a href="admin-form.html"><span class="am-icon-pencil-square-o"></span> redis工具</a></li>
                <li><a href="admin-table.html"><span class="am-icon-puzzle-piece"></span> 帮助</a></li>-->
            </ul>

            <div class="am-panel am-panel-default admin-sidebar-panel">
                <div class="am-panel-bd">
                    <p><span class="am-icon-bookmark"></span> 联系方式</p>
                    <p>xiaolyuh@163.com</p>
                </div>
            </div>

            <div class="am-panel am-panel-default admin-sidebar-panel">
                <div class="am-panel-bd">
                    <p><span class="am-icon-tag"></span> Bug 反馈</p>
                    <p><a href="https://github.com/xiaolyuh/layering-cache/issues">GitHub Issue</a></p>
                </div>
            </div>
        </div>
    </div>
    <!-- sidebar end -->

    <!-- content start -->
    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">Layering Cache</strong> /
                    <small>缓存查看</small>
                </div>
            </div>

            <hr>

            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-3">
                    <div class="am-input-group am-input-group-sm">
                        <input type="text" class="am-form-field bind-search-input" placeholder="请输入缓存名称">
                        <span class="am-input-group-btn"><button class="am-btn am-btn-default bind-search-button"
                                                                 type="button">搜索</button></span>
                    </div>
                </div>

                <div class="am-u-sm-12 am-u-md-2">
                    <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                            <button type="button" class="am-btn am-btn-default bind-reset-stats-button"><span
                                    class="am-icon-trash-o"></span> 重置统计数据
                            </button>
                        </div>
                    </div>
                </div>
            </div>

            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main">
                            <thead>
                            <tr>
                                <th class="table-name">名称</th>
                                <th class="table-internalKey">内部缓存名</th>
                                <th class="table-internalKey">描述</th>
                                <th class="table-request-count">请求总数</th>
                                <th class="table-miss-count">未命中总数</th>
                                <th class="table-hit-rate am-hide-sm-only">命中率</th>
                                <th class="table-first-hit-rate am-hide-sm-only">一级缓存命中率</th>
                                <th class="table-second-hit-rate am-hide-sm-only">二级缓存命中率</th>
                                <th class="table-total-load-time am-hide-sm-only">加载缓存平均耗时</th>
                                <th class="table-set">操作</th>
                            </tr>
                            </thead>
                            <tbody data-bind="foreach: { data: cacheStats, as: 'stats' }">
                            <tr>
                                <td class="am-hide-sm-only" data-bind="text:stats.cacheName()"></td>
                                <td class="am-hide-sm-only" data-bind="text:stats.internalKey()">5555-5555-5555</td>
                                <td class="am-hide-sm-only" data-bind="text:stats.depict()">测试</td>
                                <td class="am-hide-sm-only" data-bind="text:stats.requestCount()">10</td>
                                <td class="am-hide-sm-only" data-bind="text:stats.missCount()">2</td>
                                <td class="am-hide-sm-only" data-bind="text:stats.hitRate">80%</td>
                                <td class="am-hide-sm-only" data-bind="text:stats.firstHitRate">70%</td>
                                <td class="am-hide-sm-only" data-bind="text:stats.secondHitRate">50%</td>
                                <td class="am-hide-sm-only" data-bind="text:stats.averageTotalLoadTime">58</td>
                                <td>
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs">
                                            <button class="am-btn am-btn-default am-btn-xs am-text-secondary"
                                                    data-bind="click: detail">
                                                <span class="am-icon-pencil-square-o"></span> 详情
                                            </button>
                                            <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"
                                                    data-bind="click: deleteCache">
                                                <span class="am-icon-trash-o"></span> 删除
                                            </button>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <div class="am-cf">
                            共 <span data-bind="text: cacheStats().length"></span> 条记录
                        </div>
                    </form>
                </div>

            </div>
        </div>

        <footer class="admin-content-footer">
            <hr>
            <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
        </footer>

    </div>
    <!-- content end -->
</div>

<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu"
   data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

<footer>
    <hr>
    <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
</footer>


<div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm">
    <div class="am-modal-dialog">
        <div class="am-modal-hd">警告！</div>
        <div class="am-modal-bd">
            你，要执行该操作吗？
        </div>
        <div class="am-modal-footer">
            <span class="am-modal-btn" data-am-modal-cancel>取消</span>
            <span class="am-modal-btn" data-am-modal-confirm>确定</span>
        </div>
    </div>
</div>


<div class="am-modal am-modal-prompt" tabindex="-1" id="delete-prompt">
    <div class="am-modal-dialog">
        <div class="am-modal-hd">删除缓存</div>
        <div class="am-modal-bd">
            <div class="am-alert am-alert-danger" data-am-alert>
                <button type="button" class="am-close">&times;</button>
                <p>如果不输入则是清空缓存</p>
            </div>
            <input type="text" class="am-modal-prompt-input" id="delete-cache-key-input" placeholder="请输入缓存key">
        </div>
        <div class="am-modal-footer">
            <span class="am-modal-btn" data-am-modal-cancel>取消</span>
            <span class="am-modal-btn" data-am-modal-confirm>提交</span>
        </div>
    </div>
</div>

<div class="am-modal am-modal-no-btn" tabindex="-1" id="detail-modal">
    <div class="am-modal-dialog">
        <div class="am-modal-hd">详情
            <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
        </div>
        <div class="am-modal-bd" style="height: 550px;overflow: auto">
            <table class="am-table am-table-bordered am-table-striped">

                <tr>
                    <td rowspan="3" class="am-text-middle">缓存基本信息</td>
                    <td>缓存名称</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().cacheName"></td>
                </tr>
                <tr>
                    <td>内部缓存名</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().internalKey"></td>
                </tr>
                <tr>
                    <td>描述</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().depict"></td>
                </tr>


                <tr>
                    <td rowspan="4" class="am-text-middle">缓存统计信息</td>
                    <td>请求总数</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().requestCount"></td>
                </tr>
                <tr>
                    <td>未命中总数</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().missCount"></td>
                </tr>
                <tr>
                    <td>命中率</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().hitRate"></td>
                </tr>
                <tr>
                    <td>加载缓存平均耗时</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().averageTotalLoadTime"></td>
                </tr>

                <tr>
                    <td rowspan="3" class="am-text-middle">一级缓存统计信息</td>
                    <td>请求总数</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().firstCacheRequestCount"></td>
                </tr>
                <tr>
                    <td>未命中总数</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().firstCacheMissCount"></td>
                </tr>
                <tr>
                    <td>缓存命中率</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().firstHitRate"></td>
                </tr>
                <tr>
                    <td>缓存预估 size</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().firstCacheSize"></td>
                </tr>

                <tr>
                    <td rowspan="5" class="am-text-middle">一级缓配置计信息</td>
                    <td>初始Size</td>
                    <td class="am-primary" data-bind="text:fcs().initialCapacity"></td>
                </tr>
                <tr>
                    <td>最大Size</td>
                    <td class="am-primary" data-bind="text:fcs().maximumSize"></td>
                </tr>
                <tr>
                    <td>失效模式</td>
                    <td class="am-primary" data-bind="text:fcs().expireMode"></td>
                </tr>
                <tr>
                    <td>失效时间</td>
                    <td class="am-primary" data-bind="text:fcs().expireTime"></td>
                </tr>
                <tr>
                    <td>时间单位</td>
                    <td class="am-primary" data-bind="text:fcs().timeUnit"></td>
                </tr>

                <tr>
                    <td rowspan="3" class="am-text-middle">二级缓存统计信息</td>
                    <td>请求总数</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().secondCacheRequestCount"></td>
                </tr>
                <tr>
                    <td>未命中总数</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().secondCacheMissCount"></td>
                </tr>
                <tr>
                    <td>缓存命中率</td>
                    <td class="am-primary" data-bind="text:detailCacheStats().secondHitRate"></td>
                </tr>

                <tr>
                    <td rowspan="4" class="am-text-middle">二级缓配置计信息</td>
                    <td>失效时间</td>
                    <td class="am-primary" data-bind="text:scs().expiration"></td>
                </tr>
                <tr>
                    <td>自动刷新时间</td>
                    <td class="am-primary" data-bind="text:scs().preloadTime"></td>
                </tr>

                <tr>
                    <td>时间单位</td>
                    <td class="am-primary" data-bind="text:scs().timeUnit"></td>
                </tr>
                <tr>
                    <td>是否强刷新</td>
                    <td class="am-primary" data-bind="text:scs().forceRefresh"></td>
                </tr>
            </table>
        </div>
    </div>
</div>

<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="js/lib/jquery.min.js"></script>
<!--<![endif]-->
<script src="js/lib/amazeui.min.js"></script>
<script src="js/lib/app.js"></script>
<script src="js/lib/knockout-3.3.0.js"></script>
<script src="js/lib/knockout.mapping.js"></script>
<script src="js/views/index.js"></script>
</body>
</html>
